﻿using DL.Characters.Player;
using UnityEngine;

namespace DL.Animation.SMB
{
    public class OnAnimationExitEvent : StateMachineBehaviour
    {
        Player player;
        public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo,
            int layerIndex)
        {
            player ??= animator.GetComponent<Player>();
        }

        public override void OnStateExit(Animator animator, AnimatorStateInfo stateInfo,
            int layerIndex)
        {
            player.OnAnimationExitEvent();
        }

        public override void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo,
            int layerIndex)
        {
 
        }
    }
}